﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EzDesk.Attendance.AttendanceImpl;
using EzDesk.Attendance.Model;

namespace EzDesk.Attendance.AttendanceImpl.Filters
{
    public static class AttendanceInfoFilters
    {
        public static IQueryable<AttendanceInfo> ByActionType(this IQueryable<AttendanceInfo> query, DutyTypeEnum actionType)
        {
            return query.Where(q => q.DutyType == actionType); 
        }

        public static IQueryable<AttendanceInfo> ByUserId(this IQueryable<AttendanceInfo> query, Guid userId)
        {
            return query.Where(p=>p.UserId == userId);
        }

        public static IQueryable<AttendanceInfo> InDay(this IQueryable<AttendanceInfo> query, DateTime day)
        {
            return query.Where(p => p.Day == day);
        }

        public static IQueryable<AttendanceInfo> IsExtrawork(this IQueryable<AttendanceInfo> query, bool isExtraWork)
        {
            return query.Where(p => p.IsExtraWork == isExtraWork);
        }

    }
}
